/*
 * @lc app=leetcode.cn id=147 lang=cpp
 *
 * [147] 对链表进行插入排序
 */

// @lc code=start
/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode() : val(0), next(nullptr) {}
 *     ListNode(int x) : val(x), next(nullptr) {}
 *     ListNode(int x, ListNode *next) : val(x), next(next) {}
 * };
 */
class Solution {
public:
/*
    ListNode* insertionSortList(ListNode* head) {
        if(head==nullptr)
            return head;
        ListNode* p=head;
        vector<int> res;
        while(p)
        {
            res.push_back(p->val);
            p=p->next;
        }
        sort(res.begin(),res.end());
        p=head;
        for(int i=0;i<res.size();i++)
        {
            p->val=res[i];
            p=p->next;
        }
        return head;
    }
    */

   
};
// @lc code=end

